import base
import numpy as np

id = "test"

img_path = base.get_img_path(id)
img = base.read_image(img_path)
x = img.shape[0] // 4
y = img.shape[1] // 4
for i in range(9):
    xi = i // 3
    yi = i % 3
    new_img = img[xi*x:xi*x + 2*x,yi*y:yi*y+2*y]

    new_id = "%s_%d_%d"%(id,xi,yi)
    new_img_path = base.get_img_path(new_id)
    base.save_img(new_img,new_img_path)
    print("Saved:"+new_img_path)


